<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width" />
    <title>Media Chrome HLS Media Example</title>
    <script type="module" src="https://cdn.jsdelivr.net/npm/hls-video-element@1.1/+esm"></script>
    <script type="module" src="../../../dist/index.js"></script>
    <style>
      /** add styles to prevent CLS (Cumulative Layout Shift) */
      media-controller:not([audio]) {
        display: block;         /* expands the container if preload=none */
        max-width: 720px;       /* allows the container to shrink if small */
        aspect-ratio: 16 / 9;   /* set container aspect ratio if preload=none */
      }

      hls-video {
        width: 100%;      /* prevents video to expand beyond its container */
        background-color: #000;
      }

      .examples {
        margin-top: 20px;
      }
    </style>
  </head>
  <body>
    <main>
      <h1>Media Chrome HLS Media Example</h1>
      <media-controller>
        <hls-video
          slot="media"
          src="https://stream.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe.m3u8"
          crossorigin
        >
          <track
            label="thumbnails"
            default
            kind="metadata"
            src="https://image.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/storyboard.vtt"
          />
        </hls-video>
        <media-control-bar>
          <media-play-button></media-play-button>
          <media-time-range></media-time-range>
          <media-mute-button></media-mute-button>
          <media-volume-range></media-volume-range>
          <media-fullscreen-button></media-fullscreen-button>
        </media-control-bar>
      </media-controller>
      <div class="examples">
        <a href="../">View more examples</a>
      </div>
    </main>
  </body>
</html>
